﻿@model OA.Model.Department

@{
    ViewBag.Title = "设置部门负责人";
    Layout = "~/Areas/Member/Views/Shared/_layer_layout.cshtml";
    string errorMsg = ViewBag.ErrorMsg;
    List<OA.Model.Position> positions = ViewBag.Positions;
}
@if (!string.IsNullOrEmpty(errorMsg))
{
    <div class="layui-tab-item layui-show">
        @errorMsg
    </div>
}
else
{
    using (Html.BeginForm(FormMethod.Post, htmlAttributes: new { @class = "layui-form" }))
    {
        @Html.AntiForgeryToken()

        <div class="layui-form-item">
            @Html.LabelFor(model => model.LeaderPositionID, new { @class = "layui-form-label" })
            <div class="layui-input-block">
                <select name="positionID">
                    <option value="">请选择</option>
                    @foreach (OA.Model.Position item in positions)
                    {
                        if (Model.LeaderPositionID == item.ID)
                        {
                            <option value="@item.ID" selected>@item.Name</option>
                        }
                        else
                        {
                            <option value="@item.ID">@item.Name</option>
                        }
                    }
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            @Html.LabelFor(model => model.LeaderPositionID2, new { @class = "layui-form-label" })
            <div class="layui-input-block">
                <select name="LeaderPositionID2">
                    <option value="">请选择</option>
                    @foreach (OA.Model.Position item in positions)
                    {
                        if (Model.LeaderPositionID2 == item.ID)
                        {
                            <option value="@item.ID" selected>@item.Name</option>
                        }
                        else
                        {
                            <option value="@item.ID">@item.Name</option>
                        }
                    }
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block" style="text-align:right;">
                <p style="color:red;">请按级层高低依次排放；领导岗位必填，领导岗位2非必填</p>
                <input type="submit" value="提 交" class="layui-btn" />
            </div>
        </div>
    }
}



<script type="text/javascript">
    layui.use(['form', 'layedit', 'autocomplete', 'element', 'layer', 'laydate'], function () {
        form = layui.form;
        layer = layui.layer;
        element = layui.element;


    });

</script>
